/* @(#)GSOrderRecSignGoodsForNonFlatAction.java   
 *
 * Project: GS
 *
 * Modify Information:
 * =============================================================================
 *   Author       Date       Description
 *   ------------ ---------- ---------------------------------------------------
 *   Jenny Li    2006-3-19     新增
 *
 * Copyright Notice:
 * =============================================================================
 *    Copyright (c) 2001-2006 Beijing HiTRUST Technology Co., Ltd. 1808 Room, 
 *        Science & Technology Building, No. 9 South Street, Zhong Guan Cun, 
 *        Haidian District, Beijing ,100081, China All rights reserved.
 *
 *    This software is the confidential and proprietary information of
 *        Beijing HiTRUST Technology Co., Ltd. ("Confidential Information").
 *        You shall not disclose such Confidential Information and shall use it
 *        only in accordance with the terms of the license agreement you entered
 *        into with HiTRUST.
 *
 * Warning:
 * =============================================================================
 * 
 */
package com.hitrust.gs.action;

import java.util.ArrayList;

import com.hitrust.gs.bean.GSOrderBean;
import com.hitrust.gs.business.GSOrderProcessor;
import com.hitrust.gs.dao.GSOrderDAO;
import com.hitrust.gs.lib.GSBaseConstants;
import com.hitrust.gs.service.GSBaseAction;
import com.hitrust.gs.service.GSBaseForm;

/**
 * 进入非网上订单明细处理－录入收货确认信息页面
 */
public class GSOrderRecSignGoodsForNonFlatAction extends GSBaseAction {

    /* (non-Javadoc)
     * @see com.hitrust.gs.service.GSBaseAction#execute(com.hitrust.gs.service.GSBaseForm)
     */
    public String execute(GSBaseForm aForm) throws Exception {
        //取得参数订单编号
//        String tOrderId = aForm.getRequest().getParameter("orderId");
//        String tOrderDetailId = aForm.getRequest().getParameter("orderDetailId");
        String obj = aForm.getRequest().getParameter("params");
        String tStr[] = obj.split(",");
        String tOrderId = tStr[1];
        String tOrderDetailId = tStr[0];
        try {
            GSOrderProcessor tGSOrderProc = new GSOrderProcessor();
            //由订单编号查询订单及所订产品明细
            ArrayList tList = tGSOrderProc.getOrderDetailForRecordSignInfo(tOrderId,tOrderDetailId);
            if(tList.size() > 0){
                aForm.getRequest().setAttribute("curorderdetail",tList.get(0));
            }
            GSOrderDAO tOrderDAO = new GSOrderDAO();
            //由订单编号查询订单信息
            GSOrderBean tBean = tOrderDAO.getOrderByTempID(tOrderId);
            aForm.getRequest().setAttribute("orderbean", tBean);
            //隐藏查询参数,暂无用
            aForm.getRequest().setAttribute("orderDetailId",tStr[2]);
            aForm.getRequest().setAttribute("providerName",tStr[3]);
            aForm.getRequest().setAttribute("concentricityId",tStr[4]);
            aForm.getRequest().setAttribute("deliverGoodsAddrId",tStr[5]);
            aForm.getRequest().setAttribute("orderDeptId",tStr[6]);
            aForm.getRequest().setAttribute("manuftype1",tStr[7]);
            aForm.getRequest().setAttribute("manuftype2",tStr[8]);
            aForm.getRequest().setAttribute("manuftype3",tStr[9]);
            aForm.getRequest().setAttribute("manufInfo",tStr[10]);
            aForm.getRequest().setAttribute("orderCreateDateStr",tStr[11]);
            aForm.getRequest().setAttribute("orderCreateDateEnd",tStr[12]);
            aForm.getRequest().setAttribute("orderDetailStatus",tStr[13]);
            
        }
        catch (Exception e) {
            aForm.getRequest().setAttribute("action","login.do");
            aForm.getRequest().setAttribute("window","true");//为出现异常准备参数
            throw e;
        }
        return GSBaseConstants.FORWARD_SUCCESS;
    }

}
